﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace for7raid.vkPlayer
{
    
    public class Group
    {
        public int ID { get; set; }
        public string Name { get; set; }


        public static List<Group> FromResponse(XmlDocument doc)
        {
            return doc.SelectNodes("/response/group").OfType<XmlNode>().Select(i => new Group()
            {
                ID = int.Parse(i["gid"].InnerText),
                Name = i["name"].InnerText.Encode()
            }).ToList();
        }
    }
}
